<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('admanage_update'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>修改广告</title>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="templates/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/layindex.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/common.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="templates/js/getuploadify.js"></script>
<script type="text/javascript" src="plugin/calendar/calendar.js"></script>
<script type="text/javascript">
 $(function () {
        //初始化表单验证
        $("#form").initValidform();
    });
function GetMode(m)
{
	if(m == "html")
	{
		$("#adarea").hide();
		$("#areahtml").show();
	}
	else
	{
		$("#adarea").show();
		$("#areahtml").hide();
	}
}
</script>
</head>

<?php
$row = $dosql->GetOne("SELECT * FROM `#@__admanage` WHERE `id`=$id");
?><body class="mainbody">
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i></i><span>返回列表页</span></a>
  <a href="home.php" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <a href="admanage.php"><span>广告管理</span></a>
  <i class="arrow"></i>
  <span>修改广告</span>
   <a href="javascript:location.reload();" class="reload">刷新</a>
</div>
<div class="line10"></div>
<!--内容-->
<div id="floatHe ad" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">修改广告</a></li>
      </ul>
    </div>
  </div>
</div>
<form name="form" id="form" method="post" action="admanage_save.php" onsubmit="return cfm_admanager();">
<div class="tab-content">
  <dl>
    <dt>投放范围</dt>
    <dd>
      <div class="rule-single-select">
		 <select name="classid" id="classid" datatype="n1-16" errormsg="请选择投放范围" sucmsg=" ">
			<option value="-1">请选择投放范围</option>
					<?php GetAllType('#@__adtype','#@__admanage','classid'); ?>
		</select>
      </div>
    </dd>
  </dl>
  <dl>
    <dt>广告标识</dt>
    <dd><input type="text" name="title" id="title" class="input normal " value="<?php echo $row['title'];?>" datatype="s" nullmsg="请填写广告标示" errormsg="格式错误" sucmsg=""/><span class="Validform_checktip">例如：某某推广第三期</span></dd>
  </dl> 
  <dl>
    <dt>展示内容</dt>
    <dd>
      <div class="rule-multi-radio">
        <span><input id="admode_1" type="radio" name="admode" value="image" <?php if($row['admode'] == 'image') echo 'checked="checked"'; ?>  onclick="GetMode('image');" /><label for="admode_1">图片
		</label>
		<input id="admode_2" type="radio" name="admode" value="flash" <?php if($row['admode'] == 'flash') echo 'checked="checked"'; ?> onclick="GetMode('flash');"  /><label for="admode_2">Flash
		</label>
		<input id="admode_3" type="radio" name="admode" value="video" <?php if($row['admode'] == 'video') echo 'checked="checked"'; ?> onclick="GetMode('video');" /><label for="admode_3">视频
		</label>
		<input id="admode_4" type="radio" name="admode" value="html"<?php if($row['admode'] == 'html') echo 'checked="checked"'; ?>  onclick="GetMode('html');"  /><label for="admode_4">HTML代码
		</label>
		</span>
      </div>
    </dd>
		<div class="line10"></div>
	<dd>
	<div id="adarea" style="<?php if($row['admode'] == 'html') echo 'display:none;';?>">
	<input type="text" name="picurl" id="picurl" class="input normal" value="<?php echo $row['picurl'];?>"/>
	<div class="upload-box upload-img">
		<div class="webuploader-pick"  onmousemove="this.className='webuploader-pick webuploader-pick-hover'" onmouseout="this.className='webuploader-pick'" onclick="GetUploadify('uploadify','广告内容上传','*.jpg;*.png;*.gif;*.swf;*.flv;*.wmv','文件格式:(*.jpg;*.png;*.gif;*.bmp;*.swf;*.flv;*.wmv)',1,<?php echo $cfg_max_file_size; ?>,'picurl')">上传...</div>
	</div>
	</div>

	<div id="areahtml" class="undis" style="<?php if($row['admode'] == 'html') echo 'display:block;';?>">
	<textarea name="areahtml" class="input"  sucmsg=" "><?php echo $row['adtext'];?></textarea>
	</div>
	</dd>
  </dl>
    <dl>
    <dt>跳转链接</dt>
    <dd><input type="text" name="linkurl" id="linkurl" class="input normal" value="<?php echo $row['linkurl'];?>"/><span class="Validform_checktip">网址请填写 http:// 开头</span></dd>
  </dl> 
    <dl>
    <dt>排列排序</dt>
    <dd><input type="text" name="orderid" id="orderid" class="input small" value="<?php echo $row['orderid'];?>" /></dd>
  </dl> 
    <dl>
    <dt>发布时间</dt>
    <dd>
      <input name="posttime" type="text" value="<?php echo GetDateTime($row['posttime']); ?>" id="posttime" class="input rule-date-input"  datatype="/^\s*$|^\d{4}\-\d{1,2}\-\d{1,2}\s{1}(\d{1,2}:){2}\d{1,2}$/" errormsg="请选择正确的日期" sucmsg=" " />
      <span class="Validform_checktip">不选择默认当前发布时间</span>
	<script type="text/javascript">
				date = new Date();
				Calendar.setup({
					inputField     :    "posttime",
					ifFormat       :    "%Y-%m-%d %H:%M:%S",
					showsTime      :    true,
					timeFormat     :    "24"
				});
				</script>
    </dd>
  </dl>
   <dl>
		<dt>发　布</dt>
		<dd>
		  <div class="rule-multi-radio">
			<span id="checkinfo"><input id="checkinfo_1" type="radio" name="checkinfo" <?php if($row['checkinfo'] == 'true') echo 'checked="checked"'; ?> value="true"/><label for="checkinfo_1">是</label>
			<input id="checkinfo_2" type="radio" name="checkinfo" value="false" <?php if($row['checkinfo'] == 'false') echo 'checked="checked"'; ?> /><label for="checkinfo_2">否</label>
			</span>
		  </div>
		  <span class="Validform_checktip">	 选择“否”则该广告不会显示在前台。</span>
	
		</dd>
	  </dl>
	 </div>
	 <div class="page-footer">
  <div class="btn-wrap">
    <input type="submit" name="btnSubmit" value="提交保存" id="btnSubmit" class="btn" />
    <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
	<input type="hidden" name="action" id="action" value="update" />
	<input type="hidden" name="id" id="id" value="<?php echo $id; ?>" />
  </div>
</div>
		
</form>
</body>
</html>